극한강수지수 및 가뭄지수
극한강수인덱스
피해량 인덱스
[]
[]
회귀 분석 결과 시각화
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/file_manager.py:211, in CachingFileManager._acquire_with_cache_info(self, needs_lock)
    210 try:
--> 211     file = self._cache[self._key]
    212 except KeyError:

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/lru_cache.py:56, in LRUCache.__getitem__(self, key)
     55 with self._lock:
---> 56     value = self._cache[key]
     57     self._cache.move_to_end(key)

KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/root/notenotenote/rx5day_1991-2020.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), 'e94b786f-2d6b-4aaa-a3b2-35b444c56a53']

During handling of the above exception, another exception occurred:

FileNotFoundError                         Traceback (most recent call last)
Cell In[27], line 30
     27 climate_variables = {}
     29 for var, path in file_paths.items():
---> 30     ds = xr.open_dataset(path, decode_times=False)
     31     # 해상도 축소
     32     climate_variables[var] = ds[var].values[:, ::sampling_interval, ::sampling_interval]

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/api.py:571, in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)
    559 decoders = _resolve_decoders_kwargs(
    560     decode_cf,
    561     open_backend_dataset_parameters=backend.open_dataset_parameters,
   (...)
    567     decode_coords=decode_coords,
    568 )
    570 overwrite_encoded_chunks = kwargs.pop("overwrite_encoded_chunks", None)
--> 571 backend_ds = backend.open_dataset(
    572     filename_or_obj,
    573     drop_variables=drop_variables,
    574     **decoders,
    575     **kwargs,
    576 )
    577 ds = _dataset_from_backend_dataset(
    578     backend_ds,
    579     filename_or_obj,
   (...)
    589     **kwargs,
    590 )
    591 return ds

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:645, in NetCDF4BackendEntrypoint.open_dataset(self, filename_or_obj, mask_and_scale, decode_times, concat_characters, decode_coords, drop_variables, use_cftime, decode_timedelta, group, mode, format, clobber, diskless, persist, lock, autoclose)
    624 def open_dataset(  # type: ignore[override]  # allow LSP violation, not supporting **kwargs
    625     self,
    626     filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
   (...)
    642     autoclose=False,
    643 ) -> Dataset:
    644     filename_or_obj = _normalize_path(filename_or_obj)
--> 645     store = NetCDF4DataStore.open(
    646         filename_or_obj,
    647         mode=mode,
    648         format=format,
    649         group=group,
    650         clobber=clobber,
    651         diskless=diskless,
    652         persist=persist,
    653         lock=lock,
    654         autoclose=autoclose,
    655     )
    657     store_entrypoint = StoreBackendEntrypoint()
    658     with close_on_error(store):

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:408, in NetCDF4DataStore.open(cls, filename, mode, format, group, clobber, diskless, persist, lock, lock_maker, autoclose)
    402 kwargs = dict(
    403     clobber=clobber, diskless=diskless, persist=persist, format=format
    404 )
    405 manager = CachingFileManager(
    406     netCDF4.Dataset, filename, mode=mode, kwargs=kwargs
    407 )
--> 408 return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:355, in NetCDF4DataStore.__init__(self, manager, group, mode, lock, autoclose)
    353 self._group = group
    354 self._mode = mode
--> 355 self.format = self.ds.data_model
    356 self._filename = self.ds.filepath()
    357 self.is_remote = is_remote_uri(self._filename)

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:417, in NetCDF4DataStore.ds(self)
    415 @property
    416 def ds(self):
--> 417     return self._acquire()

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:411, in NetCDF4DataStore._acquire(self, needs_lock)
    410 def _acquire(self, needs_lock=True):
--> 411     with self._manager.acquire_context(needs_lock) as root:
    412         ds = _nc4_require_group(root, self._group, self._mode)
    413     return ds

File ~/anaconda3/envs/gd/lib/python3.10/contextlib.py:135, in _GeneratorContextManager.__enter__(self)
    133 del self.args, self.kwds, self.func
    134 try:
--> 135     return next(self.gen)
    136 except StopIteration:
    137     raise RuntimeError("generator didn't yield") from None

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/file_manager.py:199, in CachingFileManager.acquire_context(self, needs_lock)
    196 @contextlib.contextmanager
    197 def acquire_context(self, needs_lock=True):
    198     """Context manager for acquiring a file."""
--> 199     file, cached = self._acquire_with_cache_info(needs_lock)
    200     try:
    201         yield file

File ~/anaconda3/envs/gd/lib/python3.10/site-packages/xarray/backends/file_manager.py:217, in CachingFileManager._acquire_with_cache_info(self, needs_lock)
    215     kwargs = kwargs.copy()
    216     kwargs["mode"] = self._mode
--> 217 file = self._opener(*self._args, **kwargs)
    218 if self._mode == "w":
    219     # ensure file doesn't get overridden when opened again
    220     self._mode = "a"

File src/netCDF4/_netCDF4.pyx:2470, in netCDF4._netCDF4.Dataset.__init__()

File src/netCDF4/_netCDF4.pyx:2107, in netCDF4._netCDF4._ensure_nc_success()

FileNotFoundError: [Errno 2] No such file or directory: '/root/notenotenote/rx5day_1991-2020.nc'
2015년 기준 국가별 농업 총 생산지수
Make this Notebook Trusted to load map: File -> Trust Notebook
 # 목적 : 위 데이터는 기후변화에 따른 피해량산출을 위하여 사용된 자료입니다.

 # 소개 :  이 데이터는 2015년 기준으로 농업생산량을 100으로 설정했을때 30년간 국가별 농업 생산량의 증감량을 평균하여 시각화한 지도입니다.

 - 양수 값: 해당 연도의 생산량이 2015년보다 높음을 의미합니다. 
    즉, 해당 국가가 기준 연도보다 더 많은 농산물을 생산했다는 뜻입니다.
 - 음수 값: 해당 연도의 생산량이 2015년보다 낮음을 나타냅니다. 
    즉, 해당 국가의 생산량이 기준 연도보다 감소한 것을 의미합니다.
 - 0 값: 해당 연도의 생산량이 기준 연도인 2015년과 동일함을 나타냅니다.

 # 출처 : FAOSTATDatabase